home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6188 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Calendar time
  5. Date: Fri, 23 Feb 96 00:44:08 GMT
  6. Organization: none
  7. Message-ID: <825036248snz@genesis.demon.co.uk>
  8. References: <312670A6.71F3@liant.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <312670A6.71F3@liant.com> barron@liant.com "Robert Barron" writes:
  15.  
  16. >I'm trying to print out the date and time from a supplied time_t 
  17. >variable.  However I do not want to do any timezone conversion on that 
  18. >value.
  19.  
  20. What you don't know is what timezone adjustments are already encoded into
  21. the value. If the value was generated by mktime() then localtime() should
  22. reproduce the values (so long as they were valud dates/times). Otherwise
  23. gmtime() is the alternative.
  24.  
  25. > Whenever I try to get a structure I can manipulate (gmtime, 
  26. >localtime, ctime, etc.) it always seems to convert the time and the 
  27. >hours is off.
  28.  
  29. You need to provide more information e.g. how the time_t value was generated
  30. and how the values you ended up with were 'off'.
  31.  
  32. > Is there a simple routine available that will break down 
  33. >a time_t variable into it's constituent parts without any conversion?
  34.  
  35. No, the representation of time_t is not specific by the C language and can
  36. vary from system to system.
  37.  
  38. -- 
  39. -----------------------------------------
  40. Lawrence Kirby | fred@genesis.demon.co.uk
  41. Wilts, England | 70734.126@compuserve.com
  42. -----------------------------------------
  43.